package dfbz.递归;

public class demo01 {
    public static void main(String[] args) {
        int sum = getSum(10);// 10+(10-1)
        System.out.println(sum);
    }

    private static int getSum(int i) {
        if(i==1){
            System.out.println("递归结束了....");
            return 1;
        }
        System.out.println(i);
        return i+getSum(i-1);
    }
}
